package com.lizhenhua.orderadd.controller;

import com.lizhenhua.fmmall.entity.Orders;
import com.lizhenhua.fmmall.entity.ShoppingCartVo;
import com.lizhenhua.orderadd.service.OrderAddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderAddController {


    @Autowired
    private OrderAddService orderAddService;

    @PostMapping("/save")
    public List<ShoppingCartVo> saveOrder(@RequestParam("cids") String cids, @RequestBody Orders orders) {

        List<ShoppingCartVo> list = orderAddService.saveOrder(cids, orders);



        System.out.println("--------------------------调用了 orderService 服务");
        return list;
    }


}
